var datatable;// 定义一个全局的dataTable
var tablePON
var tableOLT
var tableONU
var tableBRAS
var tableDNS
var tableSP
var cityName="全市"
var d;

var param = new Object({
	init:function(){
		this.timeSize = ''
		this.beginDate = ''
		this.endDate = ''
		this.area = ''
	},
	setTimeSizeParam:function(timeSize){
		
		var checkDate = $("#checkDate").val();
		var dayCheckDate=new XDate(checkDate);
		var dayFirstDay =dayCheckDate.toString('yyyy-MM-dd HH:mm:ss');
		var dayEndDay =dayCheckDate.toString('yyyy-MM-dd ')+("23:59:59");
		
		
		var firstDate = new Date(checkDate);
		firstDate.setDate(1); //第一天
		var monthFirstDay=new XDate(firstDate).toString('yyyy-MM-dd')+" 00:00:00";
		var endDate = new Date(firstDate);
		endDate.setMonth(firstDate.getMonth()+1);
		endDate.setDate(0);
		var monthEndDay=new XDate(endDate).toString('yyyy-MM-dd')+(" 23:59:59");
		
		
//		var time = new Date(checkDate);
//		time.setDate(time.getDate() - time.getDay() + 1);
//		var weekFirstDay=new XDate(time).toString('yyyy-MM-dd')+" 00:00:00";
//		time.setDate(time.getDate() + 6);
//		var weekEndDay=new XDate(time).toString('yyyy-MM-dd')+(" 23:59:59");

		switch(timeSize) {
			case 'day' :
				this.beginDate = dayFirstDay
				this.endDate = dayEndDay
				break
			case 'month' :
				this.beginDate = monthFirstDay
				this.endDate = monthEndDay
				break
		}
	},
	setParam:function(){
		this.init()
//		this.area = $("#te").val();
		this.area =cityName
		this.timeSize = $('input:radio[name="timeSize"]:checked').val();
		this.setTimeSizeParam(this.timeSize)
	}
});

$(function() {
	$("input:button").click(function() {
//		 $("#te").val( $(this).attr("name")); // $(this)表示获取当前被点击元素的name值
		var value =$(this).attr("name");
		cityName=value;
		$("input:button").removeClass("btn-important");
		$(this).addClass("btn-important");
		initCityKqi();
	});
	$('#table tbody').on('click', 'tr', function() {
		if ($(this).hasClass('selected')) {
			$(this).removeClass('selected');
		} else {
			datatable.$('tr.selected').removeClass('selected');
			$(this).addClass('selected');
		}
	});
	
	//showArearList("area");

});


function initkqi(){
	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").show();
		$(".web-content-hide").hide();
		
		//前一天全市得分
		getCityEv4QSY();
		
		//得分合并为一个function
		getCityEv4QSCity();

		$('#aaaDiv').waiting();
		initAaaKPI();
		
		$('#tcpDiv').waiting();
		initTcpKPI();
		
		$('#busiDiv').waiting();
		initDnsKPI();
		initHttpKPI();		
		initBusiKPI();

	});

}

function initCityKqi(){

	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").show();
		$(".web-content-hide").hide();

	    //结果
		getEvaluation(); 
		//KQI
		$('#aaaDiv').waiting();
		initAaaKPI();
		
		$('#tcpDiv').waiting();
		initTcpKPI();
		
		$('#busiDiv').waiting();
		initDnsKPI();
		initHttpKPI();		
		initBusiKPI();
	});
}

//全市所查日期的前一天的得分
function getCityEv4QSY() {
	$("#qshengY").html("");
	param.setParam();
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getCityEv4QSY?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					"param" : JSON.stringify(param)
				},
		success : function(data) {
//			var wire_full_score;
//			if(data.charData[0].wire_full_score==undefined ){
//				 wire_full_score=0
//			}else{
//				wire_full_score=data.charData[0].wire_full_score;
//			}
		    //2	
			//alert(data.charData.length);
			var access_full_score;
			if(data.charData[0].access_score==undefined || data.charData[0].access_full_score==undefined ){
				access_full_score=0
			}else{
				access_full_score=data.charData[0].access_full_score;
			}
		    //3
			var core_full_score;
			if(data.charData[0].core_score==undefined || data.charData[0].core_full_score==undefined ){
				core_full_score=0
			}else{
				core_full_score=data.charData[0].core_full_score;
			}
		    //4
			var busi_full_score;
			if(data.charData[0].busi_score==undefined || data.charData[0].busi_full_score==undefined ){
				 busi_full_score=0
			}else{
				busi_full_score=data.charData[0].busi_full_score;
			}
		    //var totalScore =100 - (busi_full_score+core_full_score+access_full_score+wire_full_score);
		    var totalScore =busi_full_score+core_full_score+access_full_score; 
		    
		    if(totalScore <= 70){
		    	$("#qshengY").css("color","red") 
		    }else if(70 < totalScore <= 90){
		    	$("#qshengY").css("color","yellow") 
		    }else if(90 < totalScore){
		    	$("#qshengY").css("color","blue")
		    }
		    
		    
		    $("#qshengY").html(totalScore.toFixed(2));
			
		}
	});
}

//全市和各区县所查日期的得分
function getCityEv4QSCity() {
	$('#cityEv4QSCityDiv').waiting();
	$('#evaluationDiv').waiting();
	param.setParam();
	//数据清空
	$("#qsheng").html("");
	$("input:button").each(function() {
  		var value =$(this).attr("name");  	
  		$(this).attr('value',value+":");  		
  	});
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getCityEv4QSCity?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					"param" : JSON.stringify(param)
				},
		success : function(data) {
			$('#cityEv4QSCityDiv').waiting('done');
			$('#evaluationDiv').waiting('done');
			
			$.each(data.charData, function(index,cityData){
				//接入得分
				var access_full_score;
				if(cityData.access_score==undefined || cityData.access_full_score==undefined ){
					access_full_score=0
				}else{
					access_full_score=cityData.access_full_score;
				}
			    //网络
				var core_full_score;
				if(cityData.core_score==undefined || cityData.core_full_score==undefined ){
					core_full_score=0
				}else{
					core_full_score=cityData.core_full_score;
				}
			    //业务
				var busi_full_score;
				if(cityData.busi_score==undefined || cityData.busi_full_score==undefined ){
					 busi_full_score=0
				}else{
					busi_full_score=cityData.busi_full_score;
				}
			   // var totalScore =100 - (busi_full_score+core_full_score+access_full_score+wire_full_score);
			    var totalScore =busi_full_score+core_full_score+access_full_score; 
			    if(cityData.city_code=="全市"){
			    	if(totalScore <= 70){
				    	$("#qsheng").css("color","red") 
				    }else if(70 < totalScore <= 90){
				    	$("#qsheng").css("color","yellow") 
				    }else if(90 < totalScore){
				    	$("#qsheng").css("color","blue")
				    }
				    
				    $("#qsheng").html(totalScore.toFixed(2));
				    
				    //处理全省的得分数据
				    genEvaluation(cityData);
			    }else{
			    	$("input:button").each(function() {
//			   		 $("#te").val( $(this).attr("name")); // $(this)表示获取当前被点击元素的name值
			   		var value =$(this).attr("name");
			   		if(value==cityData.city_code){
			   			if(totalScore <= 70){
			   				$(this).removeClass("btn btn-info");
			   				$(this).removeClass("btn btn-warning");
			   				$(this).addClass("btn btn-danger");
					    }else if(70 < totalScore <= 90){
					    	$(this).removeClass("btn btn-info");
					    	$(this).removeClass("btn btn-danger");
					    	$(this).addClass("btn btn-warning");
					    }
			   			$(this).attr('value',value+":"+totalScore.toFixed(2));
			   			return;
			   		}
			   	});
			    }			   
			});						
		}
	});
}


//// 全市所查日期的得分
//function getCityEv4QS() {
//	param.setParam();
//	$.ajax({
//		type : "POST",
//		url : "../../businessSense/QWAnalysis/getCityEv4QS?rand="
//				+ Math.random(),
//		dataType : "json",
//				"data" : {
//					"param" : JSON.stringify(param)
//				},
//		success : function(data) {
//			var wire_full_score;
//			if(data.charData[0].wire_full_score==undefined ){
//				 wire_full_score=0
//			}else{
//				wire_full_score=data.charData[0].wire_full_score;
//			}
//		    //2	
//			var access_full_score;
//			if(data.charData[0].access_score==undefined || data.charData[0].access_full_score==undefined ){
//				access_full_score=0
//			}else{
//				access_full_score=data.charData[0].access_full_score;
//			}
//		    //3
//			var core_full_score;
//			if(data.charData[0].core_score==undefined || data.charData[0].core_full_score==undefined ){
//				core_full_score=0
//			}else{
//				core_full_score=data.charData[0].core_full_score;
//			}
//		    //4
//			var busi_full_score;
//			if(data.charData[0].busi_score==undefined || data.charData[0].busi_full_score==undefined ){
//				 busi_full_score=0
//			}else{
//				busi_full_score=data.charData[0].busi_full_score;
//			}
//		    var totalScore =100 - (busi_full_score+core_full_score+access_full_score+wire_full_score);
//		    
//		    if(totalScore <= 70){
//		    	$("#qsheng").css("color","red") 
//		    }else if(70 < totalScore <= 90){
//		    	$("#qsheng").css("color","yellow") 
//		    }else if(90 < totalScore){
//		    	$("#qsheng").css("color","blue")
//		    }
//		    
//		    $("#qsheng").html(totalScore.toFixed(2));
//			
//		}
//	});
//}


function getEvaluation() {
	param.setParam();
	
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getEvaluation?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					 "param" : JSON.stringify(param)
				},
		success : function(data) {
// json{"charData":[{"wire_score":100,"wire_full_score":1500,"access_score":350,"access_full_score":10500,"core_score":450,"core_full_score":3000,"busi_score":0,"busi_full_score":15000}]}
			//alert(data.charData[0].wire_score);
			//1
//			var wire_score;
//			var wire_full_score;
//			if(data.charData[0].wire_score==undefined || data.charData[0].wire_full_score==undefined ){
//				 wire_score=0;
//				 wire_full_score=0
//			}else{
//				wire_score=data.charData[0].wire_score;
//				wire_full_score=data.charData[0].wire_full_score;
//			}
//			$("#WNEval").html(wire_score);
//		    $("#WNInf").html(wire_full_score);
		    //2	
		    var access_score;
			var access_full_score;
			if(data.charData[0].access_score==undefined || data.charData[0].access_full_score==undefined ){
				access_score=0;
				access_full_score=0
			}else{
				access_score=data.charData[0].access_score;
				access_full_score=data.charData[0].access_full_score;
			}
			$("#ANEval").html(access_score);
		    $("#ANInf").html(access_full_score);
		    //3
		    var core_score;
			var core_full_score;
			if(data.charData[0].core_score==undefined || data.charData[0].core_full_score==undefined ){
				core_score=0;
				core_full_score=0
			}else{
				core_score=data.charData[0].core_score;
				core_full_score=data.charData[0].core_full_score;
			}
			$("#CNEval").html(core_score);
		    $("#CNInf").html(core_full_score);
		    //4
		    var busi_score;
			var busi_full_score;
			if(data.charData[0].busi_score==undefined || data.charData[0].busi_full_score==undefined ){
				busi_score=0;
				 busi_full_score=0
			}else{
				busi_score=data.charData[0].busi_score;
				busi_full_score=data.charData[0].busi_full_score;
			}
			$("#businessEval").html(busi_score);
		    $("#businessInf").html(busi_full_score);
		    
//		    var totalScore =100 - (busi_full_score+core_full_score+access_full_score+wire_full_score);
		    var totalScore =busi_full_score+core_full_score+access_full_score;
		    $("#totalScore").html(totalScore.toFixed(2));
		}
	});
}

//根据全市数据生成得分结果
function genEvaluation(qxData) {
//	var wire_score;
//	var wire_full_score;
//	if(qxData.wire_score==undefined || qxData.wire_full_score==undefined ){
//		 wire_score=0;
//		 wire_full_score=0
//	}else{
//		wire_score=qxData.wire_score;
//		wire_full_score=qxData.wire_full_score;
//	}
//	$("#WNEval").html(wire_score);
//    $("#WNInf").html(wire_full_score);
    //2	
    var access_score;
	var access_full_score;
	if(qxData.access_score==undefined || qxData.access_full_score==undefined ){
		access_score=0;
		access_full_score=0
	}else{
		access_score=qxData.access_score;
		access_full_score=qxData.access_full_score;
	}
	$("#ANEval").html(access_score);
    $("#ANInf").html(access_full_score);
    //3
    var core_score;
	var core_full_score;
	if(qxData.core_score==undefined || qxData.core_full_score==undefined ){
		core_score=0;
		core_full_score=0
	}else{
		core_score=qxData.core_score;
		core_full_score=qxData.core_full_score;
	}
	$("#CNEval").html(core_score);
    $("#CNInf").html(core_full_score);
    //4
    var busi_score;
	var busi_full_score;
	if(qxData.busi_score==undefined || qxData.busi_full_score==undefined ){
		busi_score=0;
		 busi_full_score=0
	}else{
		busi_score=qxData.busi_score;
		busi_full_score=qxData.busi_full_score;
	}
	$("#businessEval").html(busi_score);
    $("#businessInf").html(busi_full_score);
    
   // var totalScore =100 - (busi_full_score+core_full_score+access_full_score+wire_full_score);
    var totalScore =busi_full_score+core_full_score+access_full_score;
    $("#totalScore").html(totalScore.toFixed(2));
}

function initAaaKPI() {
	param.setParam();
	
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getAaaKPI?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					 "param" : JSON.stringify(param)
				},
		success : function(dataArray) {
			$('#aaaDiv').waiting('done');
			$.each(dataArray, function(index, data) {
				if(index==0) {
					if(data.charData==undefined){
						$("#3ajqRadio").text("0");
						$("#slide1").css("left","0%");
					}else{
						$("#3ajqRadio").text(data.charData+"%");
						$("#slide1").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divp1").css( "background",d);
					$("#divp1").css( "background",dd );
					$("#divp1").css( "background",ddd );
					$("#divp1").css( "background",dddd );
				}
				if(index==1) {
					if(data.charData==undefined){
						$("#3asyRadio").text("0ms");
						$("#slide2").css("left","0%");
					}else{
						$("#3asyRadio").text(data.charData+"ms");
						$("#slide2").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divp2").css( "background",d);
					$("#divp2").css( "background",dd );
					$("#divp2").css( "background",ddd );
					$("#divp2").css( "background",dddd );
				}
			});
		}
	});
}


function initTcpKPI() {
	param.setParam();
	
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getTcpKPI?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					 "param" : JSON.stringify(param)
				},
		success : function(dataArray) {
			$('#tcpDiv').waiting('done');
			$.each(dataArray, function(index, data) {
				if(index==0) {
					if(data.charData==undefined){
						$("#tcp_succ_ratio").text("0");
						$("#slide3").css("left","0%");
					}else{
						$("#tcp_succ_ratio").text(data.charData+"%");
						$("#slide3").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divk1").css( "background",d);
					$("#divk1").css( "background",dd );
					$("#divk1").css( "background",ddd );
					$("#divk1").css( "background",dddd );
				}
				if(index==1) {
					if(data.charData==undefined){
						$("#tcp_client_delay").text("0ms");
						$("#slide4").css("left","0%");
					}else{
						$("#tcp_client_delay").text(data.charData+"ms");
						$("#slide4").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divk2").css( "background",d);
					$("#divk2").css( "background",dd );
					$("#divk2").css( "background",ddd );
					$("#divk2").css( "background",dddd );
				}
				if(index==2) {
					if(data.charData==undefined){
						$("#tcp_server_delay").text("0ms");
						$("#slide5").css("left","0%");
					}else{
						$("#tcp_server_delay").text(data.charData+"ms");
						$("#slide5").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divk3").css( "background",d);
					$("#divk3").css( "background",dd );
					$("#divk3").css( "background",ddd );
					$("#divk3").css( "background",dddd );
				}
				if(index==3) {
					if(data.charData==undefined){
						$("#tcp_retrans_ul_ratio").text("0");
						$("#slide6").css("left","0%");
					}else{
						$("#tcp_retrans_ul_ratio").text(data.charData+"%");
						$("#slide6").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divk4").css( "background",d);
					$("#divk4").css( "background",dd );
					$("#divk4").css( "background",ddd );
					$("#divk4").css( "background",dddd );
				}
				if(index==4) {
					if(data.charData==undefined){
						$("#tcp_retrans_dl_ratio").text("0");
						$("#slide7").css("left","0%");
					}else{
						$("#tcp_retrans_dl_ratio").text(data.charData+"%");
						$("#slide7").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divk5").css( "background",d);
					$("#divk5").css( "background",dd );
					$("#divk5").css( "background",ddd );
					$("#divk5").css( "background",dddd );
				}
			});
		}
	});
}

function initDnsKPI() {
	param.setParam();
	
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getDnsKPI?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					 "param" : JSON.stringify(param)
				},
		success : function(dataArray) {
			$('#busiDiv').waiting('done');
			$.each(dataArray, function(index, data) {
				if(index==0) {
					if(data.charData==undefined){
						$("#dns_succ_ratio").text("0");
						$("#slide8").css("left","0%");
					}else{
						$("#dns_succ_ratio").text(data.charData+"%");
						$("#slide8").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divb1").css( "background",d);
					$("#divb1").css( "background",dd );
					$("#divb1").css( "background",ddd );
					$("#divb1").css( "background",dddd );
				}
				if(index==1) {
					if(data.charData==undefined){
						$("#dns_delay").text("0ms");
						$("#slide9").css("left","0%");
					}else{
						$("#dns_delay").text(data.charData+"ms");
						$("#slide9").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divb2").css( "background",d);
					$("#divb2").css( "background",dd );
					$("#divb2").css( "background",ddd );
					$("#divb2").css( "background",dddd );
				}
			});
		}
	});
}

function initHttpKPI() {
	param.setParam();
	
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getHttpKPI?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					 "param" : JSON.stringify(param)
				},
		success : function(dataArray) {
			$('#busiDiv').waiting('done');
			$.each(dataArray, function(index, data) {
				if(index==0) {
					if(data.charData==undefined){
						$("#http_succ_ratio").text("0");
						$("#slide10").css("left","0%");
					}else{
						$("#http_succ_ratio").text(data.charData+"%");
						$("#slide10").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divb3").css( "background",d);
					$("#divb3").css( "background",dd );
					$("#divb3").css( "background",ddd );
					$("#divb3").css( "background",dddd );
				}
				if(index==1) {
					if(data.charData==undefined){
						$("#frist_pack_time_delay").text("0ms");
						$("#slide11").css("left","0%");
					}else{
						$("#frist_pack_time_delay").text(data.charData+"ms");
						$("#slide11").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divb4").css( "background",d);
					$("#divb4").css( "background",dd );
					$("#divb4").css( "background",ddd );
					$("#divb4").css( "background",dddd );
				}
				if(index==2) {
					if(data.charData==undefined){
						$("#frist_page_time_delay").text("0ms");
						$("#slide12").css("left","0%");
					}else{
						$("#frist_page_time_delay").text(data.charData+"ms");
						$("#slide12").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divb5").css( "background",d);
					$("#divb5").css( "background",dd );
					$("#divb5").css( "background",ddd );
					$("#divb5").css( "background",dddd );
				}
			});
		}
	});
}

function initBusiKPI() {
	param.setParam();
	
	$.ajax({
		type : "POST",
		url : "../../businessSense/QWAnalysis/getBusiKPI?rand="
				+ Math.random(),
		dataType : "json",
				"data" : {
					 "param" : JSON.stringify(param)
				},
		success : function(dataArray) {
			$('#busiDiv').waiting('done');
			$.each(dataArray, function(index, data) {
				if(index==0) {
					if(data.charData==undefined){
						$("#video_speed").text("0kbps");
						$("#slide13").css("left","0%");
					}else{
						$("#video_speed").text(data.charData+"kbps");
						$("#slide13").css("left",data.slideData+"%");
					}
					
					var d="-webkit-linear-gradient(left,";
					var dd="-o-linear-gradient(left,";
					var ddd="-moz-linear-gradient(left,";
					var dddd="linear-gradient(to right,";
					var colors="";
					for(var i=0;i<data.color.length;i++){
						colors+=data.color[i][1]+" "+data.color[i][0]+"% ,";
					}
					colors=colors.substring(0,colors.length-1)+")";
					d+=colors;
					dd+=colors;
					ddd+=colors;
					dddd+=colors;
					
					$("#divb6").css( "background",d);
					$("#divb6").css( "background",dd );
					$("#divb6").css( "background",ddd );
					$("#divb6").css( "background",dddd );
				}
			});
		}
	});
}



function goToAAADetails() {
	var timeSize =$('input:radio[name="timeSize"]:checked').val();
	var queryDate = $("#checkDate").val();
	var area = param.area;
	var title = "AAA性能分析";
	var url = "/businessAnalysis/AaaKpi/index?timeSize=" + timeSize + "&queryTime="+ queryDate +"&city_code=" + area +"&jspType=qwkpidetail";
	linkTab(title,url);
}

function goToTcpDetails() {
	var timeSize =$('input:radio[name="timeSize"]:checked').val();
	var queryDate = $("#checkDate").val();
	var area = param.area;
	var title = "TCP性能分析";
	var url = "/businessAnalysis/TCPAnalysis/index?timeSize=" + timeSize + "&queryTime="+ queryDate +"&city_code=" + area +"&jspType=qwkpidetail";
	linkTab(title,url);
}

function goToHttpDetails() {
	var timeSize =$('input:radio[name="timeSize"]:checked').val();
	var queryDate = $("#checkDate").val();
	var area = param.area;
	var title = "HTTP过程指标";
	var url = "/businessAnalysis/hcq/index?timeSize=" + timeSize + "&queryTime="+ queryDate +"&city_code=" + area +"&jspType=qwkpidetail";
	linkTab(title,url);
}

function goToBusiDetails() {
	var timeSize =$('input:radio[name="timeSize"]:checked').val();
	var queryDate = $("#checkDate").val();
	var area = param.area;
	var title = "通用业务性能";
	var url = "/businessAnalysis/commonBusinessAnalysis/index?timeSize=" + timeSize + "&queryTime="+ queryDate +"&city_code=" + area +"&jspType=qwkpidetail";
	linkTab(title,url);
}

function goToDnsDetails() {
	var timeSize =$('input:radio[name="timeSize"]:checked').val();
	var queryDate = $("#checkDate").val();
	var area = param.area;
	var title = "DNS指标";
	var url = "businessAnalysis/DNSAnalysis/index?timeSize=" + timeSize + "&queryTime="+ queryDate +"&city_code=" + area +"&jspType=qwkpidetail";
	linkTab(title,url);
}

// pon
function loadGridPon(){
	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").hide();
		$(".web-content-hide").hide();
		$("#PON-show").show();
				
	    param.setParam();
		    
		$("#tablepon tbody tr").remove();
		if (tablePON == undefined || tablePON == "undefined" || tablePON == null) {
		} else {
			tablePON.destroy();
		}
		tablePON = $('#tablepon').DataTable(
				{
					"aoColumnDefs" : [ {
						sDefaultContent : '',
						aTargets : [ '_all' ]
					} ],
					"bPaginate" : false, // 翻页功能
					"bLengthChange" : false, // 改变每页显示数据数量
					"bFilter" : false, // 过滤功能
					"bSort" : false, // 排序功能
					"bInfo" : false,// 页脚信息
					"bAutoWidth" : false,// 自动宽度
					// "sPaginationType": "full_numbers",//显示分页的样式
					//					 还有simple_numbers等
//					"sScrollX" : "100%",
					"sScrollXInner" : "100%",
					"bScrollCollapse" : true,
					"oLanguage" : {
						"sLengthMenu" : "每页显示 _MENU_条",
						"sZeroRecords" : "没有找到符合条件的数据",
						"sProcessing" : "&nbsp;&nbsp;&nbsp;&nbsp;查询中，请稍等...",
						"sInfo" : "当前第 _START_ - _END_ 条　共计 _TOTAL_ 条",
						"sInfoEmpty" : "没有记录",
						"sInfoFiltered" : "(从 _MAX_ 条记录中过滤)",
						"sSearch" : "搜索：",
						"oPaginate" : {
							"sFirst" : "首页",
							"sPrevious" : "前一页",
							"sNext" : "后一页",
							"sLast" : "尾页"
						}
					},
					"bProcessing" : true,
					"bServerSide" : true,
					"sAjaxSource" : "../../businessSense/QWAnalysis/getQW4PON",
					"fnServerData" : function(sSource, aoData, fnCallback) {
						$.ajax({
							"type" : "post",
							"contentType" : "application/x-www-form-urlencoded",
							"url" : sSource,
							"dataType" : "json",
							"data" : {
								"aoData" : JSON.stringify(aoData),
								"param" : JSON.stringify(param)
								
							}, // 以json格式传递
							"success" : function(resp) {
								fnCallback(resp.allData);
							}
						});
					},
			
					columns : [ {
						data : "begindate",
					}, {
						data : "enddate",
					}, {
						data : "pon"
					}, {
						data : "qoe"
					}, {
						data : "tcp_request"
					}, {
						data : "tcp_all_success"
					}, {
						data : "tcp_server_success"
					}, {
						data : "tcp_client_success"
					}, {
						data : "tcp_client_delay"
					}, {
						data : "tcp_server_delay"
					}, {
						data : "tcp_retrans_ul_rate"
					}, {
						data : "tcp_retrans_dl_rate"
					} ]			
				});		
	});	
}
//onu
function loadGridOnu(){
	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").hide();
		$(".web-content-hide").hide();
		$("#ONU-show").show();
				
	    param.setParam();
		    
		$("#tableonu tbody tr").remove();
		if (tableONU == undefined || tableONU == "undefined" || tableONU == null) {
		} else {
			tableONU.destroy();
		}
		tableONU = $('#tableonu').DataTable(
				{
					"aoColumnDefs" : [ {
						sDefaultContent : '',
						aTargets : [ '_all' ]
					} ],
					"bPaginate" : false, // 翻页功能
					"bLengthChange" : false, // 改变每页显示数据数量
					"bFilter" : false, // 过滤功能
					"bSort" : false, // 排序功能
					"bInfo" : false,// 页脚信息
					"bAutoWidth" : false,// 自动宽度
					// "sPaginationType": "full_numbers",//显示分页的样式
					//					 还有simple_numbers等
//					"sScrollX" : "100%",
					"sScrollXInner" : "100%",
					"bScrollCollapse" : true,
					"oLanguage" : {
						"sLengthMenu" : "每页显示 _MENU_条",
						"sZeroRecords" : "没有找到符合条件的数据",
						"sProcessing" : "&nbsp;&nbsp;&nbsp;&nbsp;查询中，请稍等...",
						"sInfo" : "当前第 _START_ - _END_ 条　共计 _TOTAL_ 条",
						"sInfoEmpty" : "没有记录",
						"sInfoFiltered" : "(从 _MAX_ 条记录中过滤)",
						"sSearch" : "搜索：",
						"oPaginate" : {
							"sFirst" : "首页",
							"sPrevious" : "前一页",
							"sNext" : "后一页",
							"sLast" : "尾页"
						}
					},
					"bProcessing" : true,
					"bServerSide" : true,
					"sAjaxSource" : "../../businessSense/QWAnalysis/getQW4ONU",
					"fnServerData" : function(sSource, aoData, fnCallback) {
						$.ajax({
							"type" : "post",
							"contentType" : "application/x-www-form-urlencoded",
							"url" : sSource,
							"dataType" : "json",
							"data" : {
								"aoData" : JSON.stringify(aoData),
								"param" : JSON.stringify(param)
								
							}, // 以json格式传递
							"success" : function(resp) {
								fnCallback(resp.allData);
							}
						});
					},
			
					columns : [ {
						data : "begindate",
					}, {
						data : "enddate",
					}, {
						data : "onu"
					}, {
						data : "qoe"
					}, {
						data : "tcp_request"
					}, {
						data : "tcp_all_success"
					}, {
						data : "tcp_server_success"
					}, {
						data : "tcp_client_success"
					}, {
						data : "tcp_client_delay"
					}, {
						data : "tcp_server_delay"
					}, {
						data : "tcp_retrans_ul_rate"
					}, {
						data : "tcp_retrans_dl_rate"
					} ]			
				});		
	});	
}

//olt
function loadGridOlt(){
	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").hide();
		$(".web-content-hide").hide();
		$("#OLT-show").show();
				
	    param.setParam();
		    
		$("#tableolt tbody tr").remove();
		if (tableOLT == undefined || tableOLT == "undefined" || tableOLT == null) {
		} else {
			tableOLT.destroy();
		}
		tableOLT = $('#tableolt').DataTable(
				{
					"aoColumnDefs" : [ {
						sDefaultContent : '',
						aTargets : [ '_all' ]
					} ],
					"bPaginate" : false, // 翻页功能
					"bLengthChange" : false, // 改变每页显示数据数量
					"bFilter" : false, // 过滤功能
					"bSort" : false, // 排序功能
					"bInfo" : false,// 页脚信息
					"bAutoWidth" : false,// 自动宽度
					// "sPaginationType": "full_numbers",//显示分页的样式
					//					 还有simple_numbers等
//					"sScrollX" : "100%",
					"sScrollXInner" : "100%",
					"bScrollCollapse" : true,
					"oLanguage" : {
						"sLengthMenu" : "每页显示 _MENU_条",
						"sZeroRecords" : "没有找到符合条件的数据",
						"sProcessing" : "&nbsp;&nbsp;&nbsp;&nbsp;查询中，请稍等...",
						"sInfo" : "当前第 _START_ - _END_ 条　共计 _TOTAL_ 条",
						"sInfoEmpty" : "没有记录",
						"sInfoFiltered" : "(从 _MAX_ 条记录中过滤)",
						"sSearch" : "搜索：",
						"oPaginate" : {
							"sFirst" : "首页",
							"sPrevious" : "前一页",
							"sNext" : "后一页",
							"sLast" : "尾页"
						}
					},
					"bProcessing" : true,
					"bServerSide" : true,
					"sAjaxSource" : "../../businessSense/QWAnalysis/getQW4OLT",
					"fnServerData" : function(sSource, aoData, fnCallback) {
						$.ajax({
							"type" : "post",
							"contentType" : "application/x-www-form-urlencoded",
							"url" : sSource,
							"dataType" : "json",
							"data" : {
								"aoData" : JSON.stringify(aoData),
								"param" : JSON.stringify(param)
								
							}, // 以json格式传递
							"success" : function(resp) {
								fnCallback(resp.allData);
							}
						});
					},
			
					columns : [ {
						data : "begindate",
					}, {
						data : "enddate",
					}, {
						data : "olt"
					}, {
						data : "qoe"
					}, {
						data : "tcp_request"
					}, {
						data : "tcp_all_success"
					}, {
						data : "tcp_server_success"
					}, {
						data : "tcp_client_success"
					}, {
						data : "tcp_client_delay"
					}, {
						data : "tcp_server_delay"
					}, {
						data : "tcp_retrans_ul_rate"
					}, {
						data : "tcp_retrans_dl_rate"
					} ]			
				});		
	});	
}
//bras
function loadGrid4Bras(){
	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").hide();
		$(".web-content-hide").hide();
		$("#BRAS-show").show();
				
	    param.setParam();
		    
		$("#tablebras tbody tr").remove();
		if (tableSP == undefined || tableSP == "undefined" || tableSP == null) {
		} else {
			tableSP.destroy();
		}
		tableSP = $('#tablebras').DataTable(
				{
					"aoColumnDefs" : [ {
						sDefaultContent : '',
						aTargets : [ '_all' ]
					} ],
					"bPaginate" : false, // 翻页功能
					"bLengthChange" : false, // 改变每页显示数据数量
					"bFilter" : false, // 过滤功能
					"bSort" : false, // 排序功能
					"bInfo" : false,// 页脚信息
					"bAutoWidth" : false,// 自动宽度
					// "sPaginationType": "full_numbers",//显示分页的样式
					//					 还有simple_numbers等
//					"sScrollX" : "100%",
					"sScrollXInner" : "100%",
					"bScrollCollapse" : true,
					"oLanguage" : {
						"sLengthMenu" : "每页显示 _MENU_条",
						"sZeroRecords" : "没有找到符合条件的数据",
						"sProcessing" : "&nbsp;&nbsp;&nbsp;&nbsp;查询中，请稍等...",
						"sInfo" : "当前第 _START_ - _END_ 条　共计 _TOTAL_ 条",
						"sInfoEmpty" : "没有记录",
						"sInfoFiltered" : "(从 _MAX_ 条记录中过滤)",
						"sSearch" : "搜索：",
						"oPaginate" : {
							"sFirst" : "首页",
							"sPrevious" : "前一页",
							"sNext" : "后一页",
							"sLast" : "尾页"
						}
					},
					"bProcessing" : true,
					"bServerSide" : true,
					"sAjaxSource" : "../../businessSense/QWAnalysis/getQW4BRAS",
					"fnServerData" : function(sSource, aoData, fnCallback) {
						$.ajax({
							"type" : "post",
							"contentType" : "application/x-www-form-urlencoded",
							"url" : sSource,
							"dataType" : "json",
							"data" : {
								"aoData" : JSON.stringify(aoData),
								"param" : JSON.stringify(param)
								
							}, // 以json格式传递
							"success" : function(resp) {
								fnCallback(resp.allData);
							}
						});
					},
			
					columns : [ {
						data : "begindate",
					}, {
						data : "enddate",
					}, {
						data : "bras"
					}, {
						data : "qoe"
					},  {
						data : "aaa_succ_ratio"
					}, {
						data : "aaa_delay"
					},{
						data : "tcp_request"
					}, {
						data : "tcp_all_success"
					}, {
						data : "tcp_server_success"
					}, {
						data : "tcp_client_success"
					}, {
						data : "tcp_client_delay"
					}, {
						data : "tcp_server_delay"
					}, {
						data : "tcp_retrans_ul_rate"
					}, {
						data : "tcp_retrans_dl_rate"
					} ]			
				});		
	});	
}

//sp
function loadGrid4SP(){
	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").hide();
		$(".web-content-hide").hide();
		$("#SP-show").show();
				
	    param.setParam();
		    
		$("#tablesp tbody tr").remove();
		if (tableSP == undefined || tableSP == "undefined" || tableSP == null) {
		} else {
			tableSP.destroy();
		}
		tableSP = $('#tablesp').DataTable(
				{
					"aoColumnDefs" : [ {
						sDefaultContent : '',
						aTargets : [ '_all' ]
					} ],
					"bPaginate" : false, // 翻页功能
					"bLengthChange" : false, // 改变每页显示数据数量
					"bFilter" : false, // 过滤功能
					"bSort" : false, // 排序功能
					"bInfo" : false,// 页脚信息
					"bAutoWidth" : false,// 自动宽度
					// "sPaginationType": "full_numbers",//显示分页的样式
					//					 还有simple_numbers等
//					"sScrollX" : "100%",
					"sScrollXInner" : "100%",
					"bScrollCollapse" : true,
					"oLanguage" : {
						"sLengthMenu" : "每页显示 _MENU_条",
						"sZeroRecords" : "没有找到符合条件的数据",
						"sProcessing" : "&nbsp;&nbsp;&nbsp;&nbsp;查询中，请稍等...",
						"sInfo" : "当前第 _START_ - _END_ 条　共计 _TOTAL_ 条",
						"sInfoEmpty" : "没有记录",
						"sInfoFiltered" : "(从 _MAX_ 条记录中过滤)",
						"sSearch" : "搜索：",
						"oPaginate" : {
							"sFirst" : "首页",
							"sPrevious" : "前一页",
							"sNext" : "后一页",
							"sLast" : "尾页"
						}
					},
					"bProcessing" : true,
					"bServerSide" : true,
					"sAjaxSource" : "../../businessSense/QWAnalysis/getQW4SP",
					"fnServerData" : function(sSource, aoData, fnCallback) {
						$.ajax({
							"type" : "post",
							"contentType" : "application/x-www-form-urlencoded",
							"url" : sSource,
							"dataType" : "json",
							"data" : {
								"aoData" : JSON.stringify(aoData),
								"param" : JSON.stringify(param)
								
							}, // 以json格式传递
							"success" : function(resp) {
								fnCallback(resp.allData);
							}
						});
					},
			
					columns : [ {
						data : "begindate",
					}, {
						data : "enddate",
					}, {
						data : "business_group"
					}, {
						data : "business_type"
					}, {
						data : "qoe"
					},  {
						data : "dns_request"
					}, {
						data : "dns_response_success"
					}, {
						data : "dns_success"
					},{
						data : "dns_delay"
					},{
						data : "tcp_request"
					}, {
						data : "tcp_all_success"
					}, {
						data : "tcp_server_success"
					}, {
						data : "tcp_client_success"
					}, {
						data : "tcp_client_delay"
					}, {
						data : "tcp_server_delay"
					}, {
						data : "tcp_retrans_ul_rate"
					}, {
						data : "tcp_retrans_dl_rate"
					},{
						data : "http_request"
					},{
						data : "http_success_ratio"
					},{
						data : "frist_pack_time_delay"
					},{
						data : "download_speed"
					} ]			
				});		
	});	
}

//dns
function loadGrid4DNS(){
	$('#hiddenDiv').load('../../static/html/businessSense/QWAnalysisContent.html', function() {
		$(".wrap-content-hide").hide();
		$(".web-content-hide").hide();
		$("#DNS-show").show();
				
	    param.setParam();
		    
		$("#tabledns tbody tr").remove();
		if (tableDNS == undefined || tableDNS == "undefined" || tableDNS == null) {
		} else {
			tableDNS.destroy();
		}
		tableDNS = $('#tabledns').DataTable(
				{
					"aoColumnDefs" : [ {
						sDefaultContent : '',
						aTargets : [ '_all' ]
					} ],
					"bPaginate" : false, // 翻页功能
					"bLengthChange" : false, // 改变每页显示数据数量
					"bFilter" : false, // 过滤功能
					"bSort" : false, // 排序功能
					"bInfo" : false,// 页脚信息
					"bAutoWidth" : false,// 自动宽度
					// "sPaginationType": "full_numbers",//显示分页的样式
					//					 还有simple_numbers等
//					"sScrollX" : "100%",
					"sScrollXInner" : "100%",
					"bScrollCollapse" : true,
					"oLanguage" : {
						"sLengthMenu" : "每页显示 _MENU_条",
						"sZeroRecords" : "没有找到符合条件的数据",
						"sProcessing" : "&nbsp;&nbsp;&nbsp;&nbsp;查询中，请稍等...",
						"sInfo" : "当前第 _START_ - _END_ 条　共计 _TOTAL_ 条",
						"sInfoEmpty" : "没有记录",
						"sInfoFiltered" : "(从 _MAX_ 条记录中过滤)",
						"sSearch" : "搜索：",
						"oPaginate" : {
							"sFirst" : "首页",
							"sPrevious" : "前一页",
							"sNext" : "后一页",
							"sLast" : "尾页"
						}
					},
					"bProcessing" : true,
					"bServerSide" : true,
					"sAjaxSource" : "../../businessSense/QWAnalysis/getQW4DNS",
					"fnServerData" : function(sSource, aoData, fnCallback) {
						$.ajax({
							"type" : "post",
							"contentType" : "application/x-www-form-urlencoded",
							"url" : sSource,
							"dataType" : "json",
							"data" : {
								"aoData" : JSON.stringify(aoData),
								"param" : JSON.stringify(param)
								
							}, // 以json格式传递
							"success" : function(resp) {
								fnCallback(resp.allData);
							}
						});
					},
			
					columns : [ {
						data : "begindate",
					}, {
						data : "enddate",
					}, {
						data : "dns_ip"
					}, {
						data : "qoe"
					},  {
						data : "dns_request"
					}, {
						data : "dns_response_success"
					}, {
						data : "dns_success"
					},{
						data : "dns_delay"
					} ]			
				});		
	});	
}

function exportDevice(deviceType) {
	param.setParam();
	var paramsObj = {};
	paramsObj["timeSize"] = param.timeSize;
	paramsObj["beginDate"] = param.beginDate;
	paramsObj["endDate"] = param.endDate;
	paramsObj["area"] = param.area;		
	paramsObj["deviceType"] = deviceType;
	location.href='../../businessSense/QWAnalysis/getQW4ReportExport' + json2Params(paramsObj);
} 

//下拉树 begin
function onClick(e, treeId, treeNode) {
	var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
	nodes = zTree.getSelectedNodes(),
	v = "";
	nodes.sort(function compare(a,b){return a.id-b.id;});
	for (var i=0, l=nodes.length; i<l; i++) {
		v += nodes[i].name + ",";
	}
	if (v.length > 0 ) v = v.substring(0, v.length-1);
	var cityObj = $("#citySel");
	cityObj.attr("value", v);
	$("#area").val(treeNode.id);
	
	hideMenu();
}
function showMenu() {
	var cityObj = $("#citySel");
	var cityOffset = $("#citySel").offset();
	$("#menuContent").css({left:cityOffset.left-26 + "px", top:cityOffset.top-116 + "px"}).slideDown("fast");

	$("body").bind("mousedown", onBodyDown);
}
function hideMenu() {
	$("#menuContent").fadeOut("fast");
	$("body").unbind("mousedown", onBodyDown);
}
function onBodyDown(event) {
	if (!(event.target.id == "menuBtn" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
		hideMenu();
	}
}
//下拉树 end



function resetQueryForm() {
	$('#queryForm')[0].reset();
}

//function exportExcel() {
//	$.ajax({
//		type : "POST",
//		url : "../../businessAnalysis/attachment/exportBigDataExcel?rand="
//				+ Math.random(),
//		dataType : "json",
//		"data" : {
//			"allData" : JSON.stringify(d)
//		},
//		success : function(data) {
//			alert(data.msgs);
//		}
//	});
//}